<?php $this->load->view('admin/header'); ?>
<div class="main clear">
    <?php if($op=='list'):?>
    <div class="tool">
        <a href="/html//" >生成网站首页</a>
        <a href="/html//" >生成所有栏目页</a>
        <a href="/html//" >生成所有文章页</a>
        <a href="/index.php?d=admin&c=type&m=edit">添加栏目</a>
    </div>
    <div class="table01">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <th width="10%"><strong>栏目</strong></th>
                <th width="45%"><strong>操作</strong></th>
            </tr>
            <?php foreach($type_arr as $k=>$v):?>
                <tr>
                    <td><span><?php echo $v['typename'];?></span></td>
                    <td>

                        <a target="_blank" href="/index.php?c=create&m=create_list&typeid=<?php echo $v['catid'];?>">生成栏目</a>|
                        <a target="_blank" href="/index.php?c=create&m=create_all_cont&&typeid=<?php echo $v['catid'];?>" >生成文档</a>|
                        <a href="/index.php?d=admin&c=article_edit&m=add&catid=<?php echo $v['catid'];?>">发布文档</a>|
                        <a href="/index.php?d=admin&c=article_list&typeid=<?php echo $v['catid'];?>">内容</a>|
                        <a href="/index.php?d=admin&c=type&m=edit&catid=<?php echo $v['catid'];?>">修改</a>|
                        <a href="javascript:alert('后期开放!');">浏览</a>
                    </td>
                </tr>
            <?php endforeach;?>
        </table>
    </div>
    <?php elseif($op == 'edit' || $op == 'add'):?>
    <div class="tool">
        <a href="/admin/type/">栏目列表</a>
        <?php if($op == 'edit'):?><a href="javascript:void(0)">编辑栏目</a><?php endif;?>
        <?php if($op == 'add'):?><a href="javascript:void(0)">添加栏目</a><?php endif;?>
    </div>
    <div class="table01">
        <form id="game_form" action="/index.php?d=admin&c=type&m=save" method="post">
            <div class="add_item">
                <label>栏目名称：</label>
                <input id="typedir" class="txt" style="width: 100px;" type="text" value="<?php if(!empty($info['typename'])){echo $info['typename'];}?>" name="typename">
            </div>
            <div class="add_item">
                <label>栏目目录：</label>
                <input id="typedir" class="txt" style="width: 100px;" type="text" value="<?php if(!empty($info['typedir'])){echo $info['typedir'];}?>" name="typedir">
            </div>
            <div class="add_item">
                <label>栏目标题：</label>
                <input id="title" class="txt" style="width: 800px;" type="text" value="<?php if(!empty($info['title'])){echo $info['title'];}?>" name="title">
            </div>
            <div class="add_item">
                <label>栏目关键字：</label>
                <input id="keywords" class="txt" style="width: 800px;" type="text" value="<?php if(!empty($info['keywords'])){echo $info['keywords'];}?>" name="keywords">
            </div>
            <div class="add_item">
                <label>栏目描述：</label>
                <input id="description" class="txt" style="width: 1000px;" type="text" value="<?php if(!empty($info['description'])){echo $info['description'];}?>" name="description">
            </div>
            <div class="btn_box">
                <input type="hidden" name="catid" value="<?if(!empty($info['catid'])){echo $info['catid'];}?>">
                <input type="submit"  value="保存" name="">
                <input type="button" onclick="fanhui()" value="返回" name="">
            </div>
            <script type="text/javascript">
                function fanhui(){
                    history.back();
                }
            </script>
        </form>
    </div>
    <?php endif;?>
</div>

<?php $this->load->view('admin/footer'); ?>